# MT::Plugin::SanitizeEx
# Author: Takashi Ishikawa (http://www.ana-kutsu.com/)
# Copyright (C) 2011, Takashi Ishikawa.
#
# This program is distributed under the terms of the
# GNU General Public License, version 2.


package MT::Plugin::SanitizeEx;
use strict;

use base qw( MT::Plugin );
use MT::Template::Context;
use MT::Sanitize;
use MT::Log;

my $plugin = new MT::Plugin::SanitizeEx({
    name => 'SanitizeEx',
    version => '1.0',
    description => 'Add a sanitize global modifier. This modifier enables to specify html tag excluding sanitize.',
    doc_link => 'http://code.google.com/p/mt-plugin-sanitize-ex/wiki/InstallationAndUsage',
    author_name => "Takashi Ishikawa",
    author_link => "http://www.ana-kutsu.com/"
});
MT->add_plugin($plugin);

MT::Template::Context->add_global_filter('sanitize_ex' => \&sanitize);

sub sanitize {
	my ($strContent, $strArg, $objContxt) = @_;
	my $result = '';
	
	$result = MT::Sanitize->sanitize($strContent, $strArg);
	
	return $result;
};

1;
